package com.baizhi.service;

import com.baizhi.annotation.LogAnnotation;
import com.baizhi.dao.AdminDao;
import com.baizhi.entrty.Admin;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;
    @Override
    @LogAnnotation("登录操作")
    public Admin login(Admin admin) {

        return adminDao.login(admin);
    }

    @Override
    public void zc(String username, String s, String substring) {
        adminDao.zc(username,s,substring);
    }

    /*@Override
    public void zc(String username,String s,String substring) {
        *//*String uuid = UUID.randomUUID().toString();
        String substring = uuid.substring(0, 4);*//*
        //Md5Hash md5Hash = new Md5Hash(password, substring, 1024);
        System.out.println(s);
        System.out.println(substring+"ssssssssss");
        System.out.println(substring+"ssssssssss");
        System.out.println(username+"--uuuuuuuuu");
        System.out.println(username+"--uuuuuuuuu");
        System.out.println(username+"--uuuuuuuuu");
        adminDao.zc(username,s,substring);



    }*/
}
